
import BaseMixin from '@/views/mixin.vue'
import { HttpManageTransation } from "@/service/api/views";
import compSearch from './search';
import { FSAPI } from '@/utils/assist';
export default {
    mixins: [BaseMixin],
    components: {
        compSearch,
    },
    data() {
        return {
            title: "交易记录-管理"
        };

    },
    methods: {
        httpList: HttpManageTransation,
        handleOperate(id, type) {
            this.operate = {};
            switch (type) {
                case 'download': this.download('/api/jwt/spl/transactionrecord/export');
                    break;
            }
        },
        download(url) {
            FSAPI.download(global.APIURL_HOST + url, this.formData)
        },
        async batchOpearte() {

        },

    },
    computed: {
        columns() {
            return [{
                title: "客户组织",
                key: "organizationName",
                sortable: true,
            },{
                title: "交易时间",
                key: "createdAt",
                sortable: true,
            }, {
                title: "类型",
                key: "type",
                sortable: true,
                render(h, { row }) {
                    return <span>{row.type == 0 ? '收入' : '支出'}</span>
                }
            },{
                title: "二级分类",
                key: "category",
                sortable: true,
                render(h, { row }) {
                    switch (row.category) {
						case 0: return <div type='primary' size='small'>充值</div>; break;
						case 1: return <div type='primary' size='small'>扣费</div>; break;
						case 2: return <div type='primary' size='small'>冻结</div>; break;
						case 3: return <div type='primary' size='small'>解冻</div>; break;
						case 4: return <div type='primary' size='small'>退款</div>; break;
					}
                }
            },{
                title: "描述",
                key: "remark",
                maxWidth: 200,
            }, {
                title: "交易金额(USD)",
                key: "amount",
                sortable: true,
            }, {
                title: "账户余额",
                key: "availableAmount",
                sortable: true,
            }, {
                title: "单号",
                key: "trackingNo",
                sortable: true,
            },];
        },

    }
};




